﻿using System.Collections.Generic;
using System.Linq;

namespace Sustainalytics.ClientDW.Entities
{
    public class GCPrincipleEventIndicatorManagement : GCPrincipleEventIndicator, IEqualityComparer<GCPrincipleEventIndicatorManagement>
    {
        public string ManagementSummary { get; set; }
        public List<string> ManagementComments { get; set; }

        public bool Equals(GCPrincipleEventIndicatorManagement x, GCPrincipleEventIndicatorManagement y)
        {
            if (x == null && y == null)
                return true;

            if (x == null || y == null)
                return false;

            return
                new GCPrincipleEventIndicator().Equals(x, y)
                && x.ManagementSummary == y.ManagementSummary
                && ((x.ManagementComments == null && y.ManagementComments == null)
                    || (x.ManagementComments.SequenceEqual(y.ManagementComments)));
        }

        public int GetHashCode(GCPrincipleEventIndicatorManagement obj)
        {
            return this.Id.GetHashCode();
        }
    }
}
